/**
 * File name: Branch.java Author: Willard Wang Create date: Jul 21, 2013
 */
package edu.sjtu.se.prophet.graph;

/**
 * @author deathspeeder
 * 
 */
public class Branch extends Bucket {

    /**
     * 
     */
    private static final long serialVersionUID = -6780878504122076955L;

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < data.size() - 1; i++) {
            builder.append(data.get(i).getId());
            builder.append("->");
        }
        if (data.size() > 0)
            builder.append(data.get(data.size() - 1).getId());
        return builder.toString();
    }

    public Branch(Node singleNode) {
        data.add(singleNode);
    }

}
